#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
#include<assert.h>
char* mystrncat(char* des, char* src, int num)
{
	char* ret = des;
	assert(des && src);
	while (*des)
	{
		des++;
	}
	int i = 0;
	while ((i < num)&&(*src!='\0'))
	{
		*des++ = *src++;
		i++;
	}
		*des = '\0';
	return ret;
}
int main()
{
	char str1[20];
	char str2[20];
	char str3[20];
	strcpy(str1, "To be ");
	strcpy(str3, "To be ");
	strcpy(str2, "or not to be");
	strncat(str1, str2, 6);
	mystrncat(str3, str2, 6);
	printf("%s\n", str1);
	printf("%s\n", str3);
	return 0;
}